#ifndef PYTHONEDITOR_H
#define PYTHONEDITOR_H

#include "baseeditor.h"
#include <Qsci/qscilexerpython.h>

class PythonEditor : public BaseEditor
{
    Q_OBJECT

public:
    explicit PythonEditor(QWidget *parent = nullptr);
    ~PythonEditor() override;

    // 实现BaseEditor的纯虚函数
    void setupLanguage() override;
    void setupCodeCompletion() override;
    QStringList getKeywords() const override;
    LanguageType getLanguageType() const override;

    // Python特有的功能
    void checkSyntax() override;
    void addCustomModules(const QStringList &modules);
    void setPythonVersion(int version);

private:
    void setupPythonLexer();
    void setupPythonAPIs();
    void setupPythonKeywords();
    QStringList getPythonKeywords() const;
    QStringList getPythonBuiltins() const;
    QStringList getPythonModules() const;

    QsciLexerPython *m_pythonLexer;
    QStringList m_customModules;
    int m_pythonVersion;    // 2 or 3
};

#endif // PYTHONEDITOR_H
